<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>embedme: src/Coroutine.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Coroutine.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_coroutine_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * This file is part of libemb.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * libemb is free software: you can redistribute it and/or modify</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * the Free Software Foundation, either version 3 of the License, or</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * (at your option) any later version.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * libemb is distributed in the hope that it will be useful,</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * GNU General Public License for more details.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * along with libemb.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * Project: Embedme</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * Author : FergusZeng</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * Email  : cblock@126.com</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * git    : https://gitee.com/newgolo/embedme.git</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> * Copyright 2014-2020 @ ShenZhen ,China</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">*******************************************************************************/</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160; </div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#ifndef __COROUTINE_H__</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#define __COROUTINE_H__</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_base_type_8h.html">BaseType.h</a>&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &lt;ucontext.h&gt;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &lt;map&gt;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="comment">/* Linux进程最大堆栈空间为8M-8388608Bytes(可通过&quot;ulimit -s&quot;查看,值单位为K) */</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#define $COROUTINE_STACK_SIZE (1048576) </span><span class="comment">/* 1M bytes:1024*1024=1048576 */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keyword">namespace </span>libemb{</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="keyword">class </span>CoScheduler;</div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="_coroutine_8h.html#a3f4fad34f91591dfbdf668a6ee38aa94">   45</a></span>&#160;<span class="keyword">enum class</span> <a class="code" href="_coroutine_8h.html#a3f4fad34f91591dfbdf668a6ee38aa94">CoroutineState</a></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;{</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    Stop=0,</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    Start,</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    Suspend</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;};</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="classlibemb_1_1_coroutine.html">   56</a></span>&#160;<span class="keyword">class </span><a class="code" href="classlibemb_1_1_coroutine.html">Coroutine</a>{</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<a class="code" href="_base_type_8h.html#a57e803e49526dc5ba8c1915c68708ae0">DECL_CLASSNAME</a>(<a class="code" href="classlibemb_1_1_coroutine.html">Coroutine</a>)</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <a class="code" href="classlibemb_1_1_coroutine.html">Coroutine</a>();</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="classlibemb_1_1_coroutine.html">Coroutine</a>();</div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="classlibemb_1_1_coroutine.html#aecbf19687671f4c46bf0111babccdb34">   65</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classlibemb_1_1_coroutine.html#aecbf19687671f4c46bf0111babccdb34">routine</a>()=0;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_coroutine.html#a72d2ee817d81859543ef326983471ddb">coroutineID</a>();</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <a class="code" href="_coroutine_8h.html#a3f4fad34f91591dfbdf668a6ee38aa94">CoroutineState</a> <a class="code" href="classlibemb_1_1_coroutine.html#ae2e9d6c4aace1bb2cdf2f82d09c6d4c4">state</a>();</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classlibemb_1_1_coroutine.html#a1bc4de04653687fc239ace0d15661992">usleep</a>(<span class="keywordtype">int</span> us);</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classlibemb_1_1_coroutine.html#a047ac6774fb263066f3bdf54230d5437">msleep</a>(<span class="keywordtype">int</span> ms);</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_coroutine.html#a1b79e5fbd51800e261a03e66fa67fb37">isRunning</a>();</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="keywordtype">void</span> resume();  </div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="keywordtype">void</span> yield();</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="keywordtype">void</span> saveStack();</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="keywordtype">void</span> restoreStack();</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classlibemb_1_1_co_scheduler.html">CoScheduler</a>;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <a class="code" href="classlibemb_1_1_co_scheduler.html">CoScheduler</a>* m_scheduler;</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keywordtype">int</span> m_id;</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    ucontext_t m_context;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <a class="code" href="_coroutine_8h.html#a3f4fad34f91591dfbdf668a6ee38aa94">CoroutineState</a> m_state{CoroutineState::Stop};</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="keywordtype">int</span> m_stackSize{0};</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    std::unique_ptr&lt;char[]&gt; m_stackBuffer;</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;};</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160; </div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="classlibemb_1_1_co_scheduler.html">  112</a></span>&#160;<span class="keyword">class </span><a class="code" href="classlibemb_1_1_co_scheduler.html">CoScheduler</a>{</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<a class="code" href="_base_type_8h.html#a57e803e49526dc5ba8c1915c68708ae0">DECL_CLASSNAME</a>(<a class="code" href="classlibemb_1_1_co_scheduler.html">CoScheduler</a>)</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <a class="code" href="classlibemb_1_1_co_scheduler.html">CoScheduler</a>();</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="classlibemb_1_1_co_scheduler.html">CoScheduler</a>();</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_co_scheduler.html#acec8efe9475154f54e3714954bfe7739">start</a>(std::shared_ptr&lt;Coroutine&gt; coroutine);</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classlibemb_1_1_co_scheduler.html#a723316c1527d381780a014e1fa04d073">schedule</a>(<span class="keywordtype">int</span> coroutineID);</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classlibemb_1_1_co_scheduler.html#a663b9e4fc25a50033814b0b0201ab34e">stop</a>(<span class="keywordtype">int</span> coroutineID);</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_co_scheduler.html#af7f935a73bed46720a483f4c76945548">routines</a>();</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    <span class="keywordtype">void</span>* <a class="code" href="classlibemb_1_1_co_scheduler.html#ad6d7cffae8f21229acc643f6101b7338">context</a>();</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    <span class="keywordtype">char</span>* <a class="code" href="classlibemb_1_1_co_scheduler.html#ad10cb5db53c8c54d984a2d2ff5f5f238">stack</a>();</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> coroutineEntry(<span class="keywordtype">void</span>* coroutine);</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    std::map&lt;int, std::shared_ptr&lt;Coroutine&gt;&gt; m_coroutineMap;</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    ucontext_t m_context;</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    <span class="keywordtype">char</span> m_stack[$COROUTINE_STACK_SIZE];</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;};</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160; </div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;}</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclasslibemb_1_1_coroutine_html_a1b79e5fbd51800e261a03e66fa67fb37"><div class="ttname"><a href="classlibemb_1_1_coroutine.html#a1b79e5fbd51800e261a03e66fa67fb37">libemb::Coroutine::isRunning</a></div><div class="ttdeci">bool isRunning()</div><div class="ttdoc">判断协程是否正在运行</div><div class="ttdef"><b>Definition:</b> Coroutine.cpp:74</div></div>
<div class="ttc" id="aclasslibemb_1_1_coroutine_html_a1bc4de04653687fc239ace0d15661992"><div class="ttname"><a href="classlibemb_1_1_coroutine.html#a1bc4de04653687fc239ace0d15661992">libemb::Coroutine::usleep</a></div><div class="ttdeci">void usleep(int us)</div><div class="ttdoc">微妙级休眠</div><div class="ttdef"><b>Definition:</b> Coroutine.cpp:51</div></div>
<div class="ttc" id="aclasslibemb_1_1_coroutine_html"><div class="ttname"><a href="classlibemb_1_1_coroutine.html">libemb::Coroutine</a></div><div class="ttdoc">协程类</div><div class="ttdef"><b>Definition:</b> Coroutine.h:56</div></div>
<div class="ttc" id="aclasslibemb_1_1_co_scheduler_html_ad6d7cffae8f21229acc643f6101b7338"><div class="ttname"><a href="classlibemb_1_1_co_scheduler.html#ad6d7cffae8f21229acc643f6101b7338">libemb::CoScheduler::context</a></div><div class="ttdeci">void * context()</div><div class="ttdoc">返回协程上下文</div><div class="ttdef"><b>Definition:</b> Coroutine.cpp:217</div></div>
<div class="ttc" id="a_base_type_8h_html"><div class="ttname"><a href="_base_type_8h.html">BaseType.h</a></div><div class="ttdoc">基础类型头文件</div></div>
<div class="ttc" id="a_coroutine_8h_html_a3f4fad34f91591dfbdf668a6ee38aa94"><div class="ttname"><a href="_coroutine_8h.html#a3f4fad34f91591dfbdf668a6ee38aa94">libemb::CoroutineState</a></div><div class="ttdeci">CoroutineState</div><div class="ttdoc">协程状态</div><div class="ttdef"><b>Definition:</b> Coroutine.h:46</div></div>
<div class="ttc" id="aclasslibemb_1_1_co_scheduler_html_ad10cb5db53c8c54d984a2d2ff5f5f238"><div class="ttname"><a href="classlibemb_1_1_co_scheduler.html#ad10cb5db53c8c54d984a2d2ff5f5f238">libemb::CoScheduler::stack</a></div><div class="ttdeci">char * stack()</div><div class="ttdoc">返回协程堆栈空间</div><div class="ttdef"><b>Definition:</b> Coroutine.cpp:222</div></div>
<div class="ttc" id="aclasslibemb_1_1_coroutine_html_aecbf19687671f4c46bf0111babccdb34"><div class="ttname"><a href="classlibemb_1_1_coroutine.html#aecbf19687671f4c46bf0111babccdb34">libemb::Coroutine::routine</a></div><div class="ttdeci">virtual void routine()=0</div><div class="ttdoc">协程运行体</div></div>
<div class="ttc" id="aclasslibemb_1_1_co_scheduler_html_a663b9e4fc25a50033814b0b0201ab34e"><div class="ttname"><a href="classlibemb_1_1_co_scheduler.html#a663b9e4fc25a50033814b0b0201ab34e">libemb::CoScheduler::stop</a></div><div class="ttdeci">void stop(int coroutineID)</div><div class="ttdoc">停止协程</div><div class="ttdef"><b>Definition:</b> Coroutine.cpp:195</div></div>
<div class="ttc" id="aclasslibemb_1_1_coroutine_html_a047ac6774fb263066f3bdf54230d5437"><div class="ttname"><a href="classlibemb_1_1_coroutine.html#a047ac6774fb263066f3bdf54230d5437">libemb::Coroutine::msleep</a></div><div class="ttdeci">void msleep(int ms)</div><div class="ttdoc">毫秒级休眠</div><div class="ttdef"><b>Definition:</b> Coroutine.cpp:69</div></div>
<div class="ttc" id="aclasslibemb_1_1_coroutine_html_ae2e9d6c4aace1bb2cdf2f82d09c6d4c4"><div class="ttname"><a href="classlibemb_1_1_coroutine.html#ae2e9d6c4aace1bb2cdf2f82d09c6d4c4">libemb::Coroutine::state</a></div><div class="ttdeci">CoroutineState state()</div><div class="ttdoc">获取协程状态</div><div class="ttdef"><b>Definition:</b> Coroutine.cpp:46</div></div>
<div class="ttc" id="aclasslibemb_1_1_co_scheduler_html"><div class="ttname"><a href="classlibemb_1_1_co_scheduler.html">libemb::CoScheduler</a></div><div class="ttdoc">协程调度器</div><div class="ttdef"><b>Definition:</b> Coroutine.h:112</div></div>
<div class="ttc" id="a_base_type_8h_html_a57e803e49526dc5ba8c1915c68708ae0"><div class="ttname"><a href="_base_type_8h.html#a57e803e49526dc5ba8c1915c68708ae0">DECL_CLASSNAME</a></div><div class="ttdeci">#define DECL_CLASSNAME(ClassName)</div><div class="ttdef"><b>Definition:</b> BaseType.h:176</div></div>
<div class="ttc" id="aclasslibemb_1_1_co_scheduler_html_acec8efe9475154f54e3714954bfe7739"><div class="ttname"><a href="classlibemb_1_1_co_scheduler.html#acec8efe9475154f54e3714954bfe7739">libemb::CoScheduler::start</a></div><div class="ttdeci">bool start(std::shared_ptr&lt; Coroutine &gt; coroutine)</div><div class="ttdoc">启动协程</div><div class="ttdef"><b>Definition:</b> Coroutine.cpp:143</div></div>
<div class="ttc" id="aclasslibemb_1_1_coroutine_html_a72d2ee817d81859543ef326983471ddb"><div class="ttname"><a href="classlibemb_1_1_coroutine.html#a72d2ee817d81859543ef326983471ddb">libemb::Coroutine::coroutineID</a></div><div class="ttdeci">int coroutineID()</div><div class="ttdoc">获取协程ID</div><div class="ttdef"><b>Definition:</b> Coroutine.cpp:41</div></div>
<div class="ttc" id="aclasslibemb_1_1_co_scheduler_html_a723316c1527d381780a014e1fa04d073"><div class="ttname"><a href="classlibemb_1_1_co_scheduler.html#a723316c1527d381780a014e1fa04d073">libemb::CoScheduler::schedule</a></div><div class="ttdeci">void schedule(int coroutineID)</div><div class="ttdoc">调度协程</div><div class="ttdef"><b>Definition:</b> Coroutine.cpp:187</div></div>
<div class="ttc" id="aclasslibemb_1_1_co_scheduler_html_af7f935a73bed46720a483f4c76945548"><div class="ttname"><a href="classlibemb_1_1_co_scheduler.html#af7f935a73bed46720a483f4c76945548">libemb::CoScheduler::routines</a></div><div class="ttdeci">int routines()</div><div class="ttdoc">查询当前协程个数</div><div class="ttdef"><b>Definition:</b> Coroutine.cpp:204</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>
